﻿@model NFine.Domain._02_ViewModel.UserInfoModel
@{
    ViewBag.Title = "收支明细";
    Layout = "~/Areas/WeiXinAreas/Views/Shared/_LayoutWeui.cshtml";
}
<style type="text/css">
    .weui-cells {
        margin-top:0px;
    }
    .contentt {
        background-color: white;
        border-bottom: solid #35a4fe 1px;
        height: 2.5rem;
        padding: .5rem;
    }

        .weui-cell div {
            float:left; display:block;   
            width:20%; text-align:right; color:#35a4fe;
        }
            .weui-cell div:first-child {
            width:80%; font-weight:bold;
            text-align:left;color:#000;
            }
            .weui-cell div p {
                font-size: .7rem;
                color: #86858a;
                font-weight: normal;
                margin-top:.5rem;
            }
</style>
<div class="weui-cells">
    @*@if (Model == null || Model.Count == 0)
    {
        <div class="weui-footer">暂无记录</div>
    }
    else
    {
        foreach (var payment in Model)
        {
            <div class="contentt"><div>@payment.F_Note<p>@payment.F_CreateDate.ToString("yyyy-MM-dd HH:mm")</p></div><div>+@payment.F_Income</div>
                }
                else
                {
                    <div>
                        @payment.F_Income
                    </div>
                }

            </div>
        }
    }*@
</div>
<div class="weui-loadmore" id="divMore">
    <i class="weui-loading"></i>
    <span class="weui-loadmore__tips">正在加载...</span>
</div>

<div style="height:60px;"></div>
<div class="weui-tabbar" style="position:fixed;">
    <a href="~/WeiXinAreas/Main/Index" class="weui-tabbar__item">
        <div class="weui-tabbar__icon">
            <img src="~/Content/M/img/home@2x.png" alt="">
        </div>
        <p class="weui-tabbar__label">首页</p>
    </a>
    <a href="~/WeiXinAreas/Main/NewsList" class="weui-tabbar__item">
        <div class="weui-tabbar__icon">
            <img src="~/Content/M/img/kecheng@2x.png" alt="">
        </div>
        <p class="weui-tabbar__label">新闻</p>
    </a>
    <a href="javascript:;" class="weui-tabbar__item weui-bar__item--on">
        <div class="weui-tabbar__icon">
            <img src="~/Content/M/img/person@2x_.png" alt="">
        </div>
        <p class="weui-tabbar__label">个人</p>
    </a>
</div>


@section footScript
{
    <script type="text/javascript">
        //上拉加载更多
        var loading = false;  //状态标记
        var _page = 1;
        $(document).ready(function () {
            initMoreData();
             $(document.body).infinite().on("infinite", function () {
                    if (loading) return;
                    loading = true;
                    setTimeout(function () {
                        _page++;
                        initMoreData();
                    }, 1000);
                });
        });
        function initMoreData() {
            $.ajax({
                url: "getMorePayments?pagenum=" + _page+"&count=10",
                dataType: 'json',
                type: 'post',
                success: function (_data) {
                    loading = false;
                    var _html = '';

                    for (var i = 0, len = _data.length; i < len; i++) {
                        var live = _data[i];
                        _html += '<div class="weui-cell"><div>' + getText(live.F_BonusType) + '<p>' + live.F_BonusTime.toString("yyyy-MM-dd HH:mm") + '</p><p>'+ live.F_bz +'</p></div>';
                        if (live.F_BonusAmount > 0)
                            _html += '<div>+';
                        else
                            _html += '<div style="color:#000;">';
                        _html += live.F_BonusAmount + '</div></div>';
                       
                    }
                    $(".weui-cells").append(_html);
                    if (_data.length < 10) {
                        $(".weui-cells").after( '  <div class="weui-footer" style="margin:1rem">--已经到底了--</div>');
                        $(document.body).destroyInfinite();
                        $("#divMore").hide();
                    }
                }
            });
        }

        function getText(cellvalue)
        {
            switch (cellvalue) {
                case 0: return "工资"; break;
                case 1: return "提现"; break;
                case 2: return "提现手续费"; break;
                case 3: return "余额支付"; break;
                case 4: return "积分转增"; break;
                case 5: return "积分转增收取"; break;
                case 6: return "积分提现"; break;
                case 7: return "积分订单抵扣"; break;
                case 10:return "积分订单退回";break;
            }
        }
    </script>
}